﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Master_Page/Master_IPORT.Master" CodeBehind="frm_OtherServices.aspx.vb" Inherits="I_PORT.frm_OtherServices" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="~/Control/Confirm.ascx" TagName="Confirm1" TagPrefix="Confirm" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript" language="javascript">
    function closeModal(type) {
        // document.getElementById('ctl00_contentplaceholder1_framePopup').src = 'about:blank';
        if (type == '1') {
            var mpu = $find('ctl00_ContentPlaceHolder1_TabPayment_TabOtherService_ModalPopupExtender1');
            mpu.hide();
        }
        else if (type == 'C') {
        var mpu = $find('ctl00_ContentPlaceHolder1_TabPayment_TabOtherService_ModalPopupExtender2');
            document.getElementById('ctl00_contentplaceholder1_TabPayment_TabOtherService_btnVesselLoad').click();
            mpu.hide();

        }
        else if (type == 'B') {
        var mpu = $find('ctl00_ContentPlaceHolder1_TabPayment_TabOtherService_ModalPopupExtender3');
        document.getElementById('ctl00_contentplaceholder1_TabPayment_TabOtherService_btnBillTOLoad').click();
            mpu.hide();

        }
        else {
            var mpu = $find('ctl00_ContentPlaceHolder1_TabPayment_TabOtherService_ModalPopupExtender1');
            mpu.hide();
            document.getElementById('ctl00_contentplaceholder1_TabPayment_TabOtherService_btnLoad').click();
        }

    }
    function showBillTO() {
        document.getElementById('ctl00_contentplaceholder1_TabPayment_TabOtherService_btnTempBIll').click();

    }
    function checkNumber(e) {
        var keycode;

        if (window.event) keycode = window.event.keyCode; // ใช้ IE อ่ะ

        else if (e) keycode = e.which; // ใช้ Firefox เน่าะ

        if (((keycode > 47) && (keycode < 58)) || (keycode == 190) || (keycode == 46)) {
            return true;
        }
        return false;
    }
</script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="left">
                       <asp:TabContainer ID="TabPayment" runat="server" Width="100%" AutoPostBack="true"
                            ActiveTabIndex="0">
                            <asp:TabPanel ID="TabOtherService" runat="server" HeaderText="Other Service">
                                <ContentTemplate>
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td align="center">
                                                <fieldset style="width: 95%">
                                                    <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                        Other Service</legend>
                                                                               <table width="100%" border="0" cellpadding="2" cellspacing="0">
                               <tr>
                                            <td style="width:220px;" align="right"><asp:Label ID="Label7" runat="server" SkinID="lbtxt" Text="Teminal :" ></asp:Label>&nbsp;</td>
                                            <td align="left">
                                                <asp:RadioButtonList ID="radioPORT" runat="server" SkinID="raio">
                                                   <asp:ListItem Selected="True" Value="L">Liquid</asp:ListItem>
                                                   <asp:ListItem Value="B">Bulk</asp:ListItem>
                                                </asp:RadioButtonList> 
                                          </td>
                                </tr>
                               <tr>
                                            <td style="width:220px;" align="right"><asp:Label ID="Label16" runat="server" SkinID="lbtxt" Text="Customer :" ></asp:Label>&nbsp;</td>
                                            <td align="left">
                                                <asp:RadioButtonList ID="radioCustomer" runat="server" SkinID="raio" 
                                                    AutoPostBack="True">
                                                   <asp:ListItem Selected="True" Value="I">IN RECORD</asp:ListItem>
                                                   <asp:ListItem Value="O">ONE TIME</asp:ListItem>
                                                </asp:RadioButtonList> 
                                          </td>
                                </tr>
                           </table>
                       <table width="100%" border="0" cellpadding="2" cellspacing="0">
                           <tr>
                              <td colspan="2">
                                  <asp:Panel ID="PanelCustomer" runat="server" >
                                  <table width="100%" border="0" cellpadding="2" cellspacing="0">
                          <tr>
                            <td style="width:220px;" align="right"><asp:Label ID="lbCustomer" runat="server" SkinID="lbtxt" Text="Sold To :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                            <asp:TextBox ID="txtCustomer" runat="server" Width="300px" AutoPostBack="True" ></asp:TextBox>&nbsp;<asp:Label runat="server" id="Label8" ForeColor="Red" Text="*"></asp:Label>
             <asp:AutoCompleteExtender  runat="server" ID="AutoCompleteExtender1" BehaviorID="AutoCompleteEx2" CompletionInterval="50"
                     TargetControlID="txtCustomer" ServicePath="../WebService/AutoComplete_IPORT.asmx" 
                    ServiceMethod="GetCustomer" CompletionListCssClass="autocomplete_completionListElement"
                CompletionListItemCssClass="autocomplete_listItem"
                CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" 
                                    DelimiterCharacters="" Enabled="True" >
                <Animations>
                    <OnShow>
                        <Sequence>
                            
                            <OpacityAction Opacity="0" />
                            <HideAction Visible="true" />
                            
                            
                            <ScriptAction Script="
                                // Cache the size and setup the initial size
                                var behavior = $find('AutoCompleteEx2');
                                if (!behavior._height) {
                                    var target = behavior.get_completionList();
                                    behavior._height = target.offsetHeight - 2;
                                    target.style.height = '0px';
                                }" />
                            
                            
                            <Parallel Duration=".3">
                                <FadeIn />
                                <Length PropertyKey="height" StartValue="0" EndValueScript="$find('AutoCompleteEx2')._height" />
                            </Parallel>
                        </Sequence>
                    </OnShow>
                    <OnHide>
                        
                        <Parallel Duration=".3">
                            <FadeOut />
                            <Length PropertyKey="height" StartValueScript="$find('AutoCompleteEx2')._height" EndValue="0" />
                        </Parallel>
                    </OnHide></Animations>
                 </asp:AutoCompleteExtender>
                            </td>
                          </tr>
                                 </table>
                                  </asp:Panel>
                                  <asp:Panel ID="PanelOneTIme" runat="server" Visible="False">
                                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                          <td>
                                         
                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                        <tr>
                                            <td style="width:220px;" align="right"><asp:Label ID="Label10" runat="server" SkinID="lbtxt" Text="Sold To :" ></asp:Label>&nbsp;</td>
                                            <td align="left">
                                                  <asp:TextBox ID="txtCustomerOneTime" runat="server" Width="300px" ></asp:TextBox>&nbsp;<asp:Label runat="server" id="Label11" ForeColor="Red" Text="*"></asp:Label>
                                          </td>
                                        </tr>
                                       </table>
                                             </td>
                                        </tr>
                                   </table>
                                  </asp:Panel>
                              </td>
                           </tr>
                           </table>
                       <table width="100%" border="0" cellpadding="2" cellspacing="0">
                          <tr id="rowBillTo" runat="server" visible="False">
                              <td style="width:220px;" valign="top" align="right" runat="server"><asp:Label ID="Label9" runat="server" SkinID="lbtxt" Text="Bill To :" ></asp:Label>&nbsp;</td>
                              <td align="left" runat="server">
                                  <asp:Label ID="lbBillTO" runat="server" SkinID="lbtxt" ></asp:Label>
                              </td>
                          </tr>
                           </table>
                       <table width="100%" border="0" cellpadding="2" cellspacing="0">
                              <tr id="rowAddress" runat="server" visible="False">
                                 <td runat="server">
                                   <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                   <tr>
                                                    <td style="width:220px;" align="right"><asp:Label ID="Label12" runat="server" SkinID="lbtxt" Text="Street :" ></asp:Label>&nbsp;</td>
                                                    <td align="left" style="width:160px;">
                                                        <asp:TextBox ID="txtStreet" runat="server" Width="150px" ></asp:TextBox>&nbsp;
                                                     </td>
                                                     <td style="width:120px;" align="right"><asp:Label ID="Label14" runat="server" SkinID="lbtxt" Text="Street 4 :" ></asp:Label>&nbsp;</td>
                                                     <td align="left">
                                                        <asp:TextBox ID="txtSup" runat="server" Width="150px" ></asp:TextBox>&nbsp;
                                                     </td>
                                                  </tr>
                                                  <tr>
                                                    <td style="width:220px;" align="right"><asp:Label ID="Label17" runat="server" SkinID="lbtxt" Text="Street 5 :" ></asp:Label>&nbsp;</td>
                                                    <td align="left" style="width:160px;">
                                                        <asp:TextBox ID="txtLocation" runat="server" Width="150px" ></asp:TextBox>&nbsp;
                                                     </td>
                                                     <td style="width:120px;" align="right"><asp:Label ID="Label19" runat="server" SkinID="lbtxt" Text="District :" ></asp:Label>&nbsp;</td>
                                                     <td align="left">
                                                        <asp:TextBox ID="txtDistrict" runat="server" Width="150px"></asp:TextBox>&nbsp;
                                                     </td>
                                                  </tr>
                                                   <tr>
                                                    <td style="width:220px;" align="right"><asp:Label ID="Label21" runat="server" SkinID="lbtxt" Text="City :" ></asp:Label>&nbsp;</td>
                                                    <td align="left" style="width:160px;">
                                                        <asp:TextBox ID="txtCity" runat="server" Width="150px"></asp:TextBox>&nbsp;
                                                     </td>
                                                     <td style="width:120px;" align="right"><asp:Label ID="Label23" runat="server" SkinID="lbtxt" Text="Postal Code :" ></asp:Label>&nbsp;</td>
                                                     <td align="left">
                                                        <asp:TextBox ID="txtPostal" runat="server" Width="150px" ></asp:TextBox>&nbsp;
                                                     </td>
                                                  </tr>
                                   </table>
                                 </td>
                              </tr>
                                                  
                                               </table>
                       <table width="100%" border="0" cellpadding="2" cellspacing="0">
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label1" runat="server" SkinID="lbtxt" Text="วันที่ :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                            <asp:TextBox ID="txtDate" runat="server" Width="80px" onkeypress="return false;"></asp:TextBox>&nbsp;<asp:ImageButton
                                                                        ID="ImgDate" runat="server" ImageUrl="~/Image/calendar.png" />&nbsp;<asp:Label ID="Label36"
                                                                            runat="server" SkinID="lbtxt" Text="เวลา"></asp:Label>&nbsp;<asp:TextBox ID="txtTime" runat="server" Width="40px"></asp:TextBox>&nbsp;<asp:Label runat="server" id="lbRed" ForeColor="Red"></asp:Label>
                                                                    <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtDate"
                                                                        Format="dd MMM yyyy" 
                                    PopupButtonID="ImgDate" Enabled="True">
                                                                    </asp:CalendarExtender>
                                                                      <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtTime"
                                                                        Mask="99:99" MaskType="Time" 
                                    AcceptNegative="Left" CultureAMPMPlaceholder="" 
                                    CultureCurrencySymbolPlaceholder="" CultureDateFormat="" 
                                    CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                    CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True">
                                                                    </asp:MaskedEditExtender>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label2" runat="server" SkinID="lbtxt" Text="เรือ :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                              <asp:TextBox ID="txtBooking" runat="server" Width="300px" onkeypress="return false;" ></asp:TextBox>&nbsp;<asp:ImageButton ID="btnBooking" runat="server" ImageUrl="~/Image/Search.png" />
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right">&nbsp;</td>
                            <td align="left">
                              <asp:Button ID="btnTariff" runat="server" CssClass="ButtonStyle" Width="120px" Text="Select Tariff"  />
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right">&nbsp;</td>
                            <td align="left">
                                 <asp:UpdatePanel ID="updateTariff" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                  <asp:GridView ID="gridTariff" runat="server"  SkinID="gridblueNoPage" DataKeyNames="MATERIAL,Text_line,data2,MAT_Default,KBETR,KONWA,MAT_Relation" AutoGenerateColumns="False">
                     <Columns>
                         <asp:TemplateField Visible="false">
                            <ItemTemplate>
                               <asp:CheckBox ID="chk" runat="server" Checked="true" AutoPostBack="true" OnCheckedChanged="chkX_CheckedChanged" />
                            </ItemTemplate>
                         </asp:TemplateField>
                         <asp:BoundField HeaderText="CODE" DataField="MATERIAL" ItemStyle-Wrap="false" />
                         <asp:BoundField HeaderText="NAME" DataField="Text_line" ItemStyle-Wrap="false" />
                         <asp:BoundField HeaderText="RATE/UNIT" DataField="data2" ItemStyle-Wrap="false" />
                         <asp:TemplateField HeaderText="QTY" ItemStyle-Width="80px">
                             <ItemTemplate>
                                 <asp:TextBox ID="txtQTY" runat="server" Text="<%# Bind('count')%>" Width="50px" onkeypress="return checkNumber(this);" AutoPostBack="true" OnTextChanged="txtQTY_TextChanged" ></asp:TextBox>
                             </ItemTemplate>
                             <ItemStyle HorizontalAlign="Center" />
                         </asp:TemplateField>
                         <asp:BoundField HeaderText="AMOUNT"  ItemStyle-Wrap="false" />
                         <asp:TemplateField HeaderText="ลบ" ItemStyle-Width="50px">
                            <ItemTemplate>
                                 <asp:ImageButton ID="imgdelete" CommandName="cmddelete" CommandArgument="<%# Container.DataItemIndex %>" OnClientClick="showConfirm(this); return false;"  runat="server" ImageUrl="~/Image/cancel-24.gif" />
                             </ItemTemplate>
                         </asp:TemplateField>
                     </Columns>
                 </asp:GridView>
                </ContentTemplate>
                </asp:UpdatePanel>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right">&nbsp;</td>
                            <td align="left">
                               <asp:CheckBox ID="chkWHT" runat="server" SkinID="chkB" AutoPostBack="True" 
                                    Text="คำนวณ W/T" Checked="True" />
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label3" runat="server" SkinID="lbtxt" Text="ยอดรวม :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                              <asp:Label id="lbSum" runat="server" SkinID="lbtxt" Text="0" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label4" runat="server" SkinID="lbtxt" Text="Vat :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                              <asp:Label id="lbVat" runat="server" SkinID="lbtxt" Text="0" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label5" runat="server" SkinID="lbtxt" Text="W/T :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                              <asp:Label id="lbWHT" runat="server" SkinID="lbtxt" Text="0" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label6" runat="server" SkinID="lbtxt" Text="คงเหลือ :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                             <asp:Label id="lbNET" runat="server" SkinID="lbtxt" Text="0" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right">&nbsp;</td>
                            <td align="left">
                               <asp:Button ID="BtnSave" runat="server" CssClass="ButtonStyle" Text="บันทึกข้อมูล" />
                               <asp:Button ID="BtnPrint" runat="server" CssClass="ButtonStyle" Text="Print" 
                                    Visible="False" />
                               <asp:Button ID="BtnClear" runat="server" CssClass="ButtonStyle" Text="เคลียร์" />
                            </td>
                          </tr>
                       </table>
                                                 </fieldset>
                                            </td>
                                        </tr>
                                    </table>
                                                 <asp:Button ID="btnLoad" runat="server" Text="Button" style="display:none" />
             <asp:Button ID="btnVesselLoad" runat="server" Text="Button" style="display:none" />
             <asp:Button ID="btnBillTOLoad" runat="server" Text="Button" style="display:none" />
             <asp:Button ID="btnTempBIll" runat="server" Text="Button" style="display:none" />
              <asp:Button ID="btnTariffTemp" runat="server" Text="Button" style="display:none" />
              <asp:Button ID="btnBookingTemp" runat="server" Text="Button" style="display:none" />
            <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BackgroundCssClass="Background"
     TargetControlID="btnTariffTemp" PopupControlID="PopupAdd" DynamicServicePath="" Enabled="True" >
    </asp:ModalPopupExtender>
               <asp:ModalPopupExtender ID="ModalPopupExtender2" runat="server" BackgroundCssClass="Background"
     TargetControlID="btnBookingTemp" PopupControlID="PopupVessel" DynamicServicePath="" Enabled="True" >
    </asp:ModalPopupExtender>
      <asp:ModalPopupExtender ID="ModalPopupExtender3" runat="server" BackgroundCssClass="Background"
     TargetControlID="btnTempBIll" PopupControlID="PanelBillTO" DynamicServicePath="" Enabled="True" >
    </asp:ModalPopupExtender>
              <asp:Panel ID="PanelBillTO" runat="server" Style="display: none;">
        <table>
            <tr>
                <td>
                    <iframe runat="server" id="iframeBillTO" class="Style-Iframe" marginheight="0px" marginwidth="0px">
                    </iframe>
                </td>
            </tr>
        </table>
    </asp:Panel>
              <asp:Panel ID="PopupVessel" runat="server" Style="display: none;">
        <table>
            <tr>
                <td>
                    <iframe runat="server" id="iframeVessel" class="Style-Iframe" marginheight="0px" marginwidth="0px" >
                    </iframe>
                </td>
            </tr>
        </table>
    </asp:Panel>
              <asp:Panel ID="PopupAdd" runat="server" Style="display: none;">
        <table>
            <tr>
                <td>
                    <iframe runat="server" id="framePopup" class="Style-Iframe" marginheight="0px" marginwidth="0px">
                    </iframe>
                </td>
            </tr>
        </table>
    </asp:Panel>
                                </ContentTemplate>
                            </asp:TabPanel>
                            <asp:TabPanel ID="TabRecord" runat="server" HeaderText="Record">
                                <ContentTemplate>
                                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td align="center">
                                                <fieldset style="width: 95%">
                                                    <legend style="color: #848585; font-family: Tahoma; font-size: 14px; font-weight: bold;">
                                                        Record</legend>
                                                    <asp:Panel ID="PanelRecordOther" runat="server" >
                                                    <table width="100%" border="0" cellpadding="2" cellspacing="0">
                                                       <tr>
                                                         <td colspan="2">
                                                             <asp:GridView ID="gridRecord" runat="server"  SkinID="gridblue" DataKeyNames="Ots_ID,dayIn,TimeIn,Booking_no,Customer_no,Customer_name" AutoGenerateColumns="False">
                    <PagerTemplate>
                                                    <table>
                                                        <tr>
                                                            <td>
                                                                <asp:ImageButton ID="ImgFirst" runat="server" Height="22px" ImageUrl="../Image/arrow-first.gif"
                                                                    OnCommand="Paginate" CommandArgument="First" CommandName="Page" />
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="ImgBack" runat="server" Height="22px" ImageUrl="../Image/arrow-back.gif"
                                                                    OnCommand="Paginate" CommandArgument="Prev" CommandName="Page" />
                                                            </td>
                                                            <td valign="top">
                                                                Page
                                                                <asp:DropDownList ID="ddlPage" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPage_SelectedIndexChanged">
                                                                </asp:DropDownList>
                                                                of
                                                                <asp:Label ID="lbPageCount" runat="server" Text="Label"></asp:Label>
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="ImgNext" runat="server" Height="22px" ImageUrl="../Image/arrow-next.gif"
                                                                    OnCommand="Paginate" CommandArgument="Next" CommandName="Page" />
                                                            </td>
                                                            <td>
                                                                <asp:ImageButton ID="ImgEnd" runat="server" Height="22px" ImageUrl="../Image/arrow-end.gif"
                                                                    OnCommand="Paginate" CommandArgument="Last" CommandName="Page" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </PagerTemplate>
                     <Columns>
                          <asp:TemplateField HeaderText="NO." ItemStyle-Wrap="false" >
                           
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="LinkBooking" runat="server" Text="<%# Bind('Ots_ID') %>"
                                                                CommandArgument="<%# Container.DataItemIndex %>" CommandName="Edit"></asp:LinkButton>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                         <asp:BoundField HeaderText="DATE" DataField="dayIn" ItemStyle-Wrap="false" />
                         <asp:BoundField HeaderText="NAME" DataField="Customer_name" ItemStyle-Wrap="false" />
                     </Columns>
                 </asp:GridView>
                                                         </td>
                                                       </tr>
                                                    </table>
                                                     </asp:Panel>
                                                     <asp:Panel ID="PanelDetail" runat="server" Visible="false">
                                                      <table width="100%" border="0" cellpadding="2" cellspacing="0">
                               <tr>
                                            <td style="width:220px;" align="right"><asp:Label ID="Label13" runat="server" SkinID="lbtxt" Text="Teminal :" ></asp:Label>&nbsp;</td>
                                            <td align="left">
                                                <asp:Label ID="lbTerminal" runat="server" SkinID="lbtxt"></asp:Label>
                                          </td>
                                </tr>
                           </table>
                       <table width="100%" border="0" cellpadding="2" cellspacing="0">
                           <tr>
                              <td colspan="2">
                                  <asp:Panel ID="Panel1" runat="server" >
                                  <table width="100%" border="0" cellpadding="2" cellspacing="0">
                          <tr>
                            <td style="width:220px;" align="right"><asp:Label ID="Label18" runat="server" SkinID="lbtxt" Text="Sold To :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                                <asp:Label ID="lbSoldTodetail" runat="server" SkinID="lbtxt" ></asp:Label>
                            </td>
                          </tr>
                                 </table>
                                  </asp:Panel>
                              </td>
                           </tr>
                           </table>
                       <table width="100%" border="0" cellpadding="2" cellspacing="0">
                          <tr>
                              <td style="width:220px;" valign="top" align="right"><asp:Label ID="Label25" runat="server" SkinID="lbtxt" Text="Bill To :" ></asp:Label>&nbsp;</td>
                              <td align="left">
                                  <asp:Label ID="lbBIlltoDetail" runat="server" SkinID="lbtxt" ></asp:Label>
                              </td>
                          </tr>
                           </table>
                       <table width="100%" border="0" cellpadding="2" cellspacing="0">
                              <tr>
                                 <td>
                                   <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                   <tr>
                                                    <td style="width:220px;" align="right"><asp:Label ID="Label27" runat="server" SkinID="lbtxt" Text="Street :" ></asp:Label>&nbsp;</td>
                                                    <td align="left" style="width:160px;">
                                                        <asp:Label ID="lbStreet" runat="server" SkinID="lbtxt" ></asp:Label>
                                                     </td>
                                                     <td style="width:120px;" align="right"><asp:Label ID="Label28" runat="server" SkinID="lbtxt" Text="Street 4 :" ></asp:Label>&nbsp;</td>
                                                     <td align="left">
                                                         <asp:Label ID="lbStreet4" runat="server" SkinID="lbtxt" ></asp:Label>
                                                     </td>
                                                  </tr>
                                                  <tr>
                                                    <td style="width:220px;" align="right"><asp:Label ID="Label29" runat="server" SkinID="lbtxt" Text="Street 5 :" ></asp:Label>&nbsp;</td>
                                                    <td align="left" style="width:160px;">
                                                        <asp:Label ID="lbStreet5" runat="server" SkinID="lbtxt" ></asp:Label>
                                                     </td>
                                                     <td style="width:120px;" align="right"><asp:Label ID="Label30" runat="server" SkinID="lbtxt" Text="District :" ></asp:Label>&nbsp;</td>
                                                     <td align="left">
                                                         <asp:Label ID="lbDistrict" runat="server" SkinID="lbtxt" ></asp:Label>
                                                     </td>
                                                  </tr>
                                                   <tr>
                                                    <td style="width:220px;" align="right"><asp:Label ID="Label31" runat="server" SkinID="lbtxt" Text="City :" ></asp:Label>&nbsp;</td>
                                                    <td align="left" style="width:160px;">
                                                         <asp:Label ID="lbCity" runat="server" SkinID="lbtxt" ></asp:Label>
                                                     </td>
                                                     <td style="width:120px;" align="right"><asp:Label ID="Label32" runat="server" SkinID="lbtxt" Text="Postal Code :" ></asp:Label>&nbsp;</td>
                                                     <td align="left">
                                                         <asp:Label ID="lbPostalCOde" runat="server" SkinID="lbtxt" ></asp:Label>
                                                     </td>
                                                  </tr>
                                   </table>
                                 </td>
                              </tr>                  
                          </table>
                       <table width="100%" border="0" cellpadding="2" cellspacing="0">
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label33" runat="server" SkinID="lbtxt" Text="วันที่ :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                                 <asp:Label ID="lbDateTIme" runat="server" SkinID="lbtxt" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label37" runat="server" SkinID="lbtxt" Text="เรือ :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                                 <asp:Label ID="lbVesselName" runat="server" SkinID="lbtxt" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right">&nbsp;</td>
                            <td align="left">
                                 <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                  <asp:GridView ID="gridDetailTariff" runat="server"  SkinID="gridblueNoPage" DataKeyNames="MATERIAL,Text_line,rate,amount,total" AutoGenerateColumns="False">
                     <Columns>
                         <asp:TemplateField>
                            <ItemTemplate>
                               <asp:CheckBox ID="chk" runat="server" Checked="true" AutoPostBack="true" OnCheckedChanged="chk_CheckedChanged" />
                            </ItemTemplate>
                         </asp:TemplateField>
                         <asp:BoundField HeaderText="CODE" DataField="MATERIAL" ItemStyle-Wrap="false" />
                         <asp:BoundField HeaderText="NAME" DataField="Text_line" ItemStyle-Wrap="false" />
                         <asp:BoundField HeaderText="RATE/UNIT" DataField="rate" ItemStyle-Wrap="false" />
                         <asp:BoundField HeaderText="QTY" DataField="amount"  ItemStyle-Wrap="false" />
                         <asp:BoundField HeaderText="AMOUNT" DataField="total"  ItemStyle-Wrap="false" />
                     </Columns>
                 </asp:GridView>
                </ContentTemplate>
                </asp:UpdatePanel>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right">&nbsp;</td>
                            <td align="left">
                               <asp:CheckBox ID="CheckBox1" runat="server" SkinID="chkB" AutoPostBack="true" Text="คำนวณ W/T" Checked="true" />
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label38" runat="server" SkinID="lbtxt" Text="ยอดรวม :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                              <asp:Label id="lbSumDetail" runat="server" SkinID="lbtxt" Text="0" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label40" runat="server" SkinID="lbtxt" Text="Vat :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                              <asp:Label id="lbVatDetail" runat="server" SkinID="lbtxt" Text="0" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label42" runat="server" SkinID="lbtxt" Text="W/T :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                              <asp:Label id="lbWTDetail" runat="server" SkinID="lbtxt" Text="0" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right"><asp:Label ID="Label44" runat="server" SkinID="lbtxt" Text="คงเหลือ :" ></asp:Label>&nbsp;</td>
                            <td align="left">
                             <asp:Label id="lbNETDetail" runat="server" SkinID="lbtxt" Text="0" ></asp:Label>
                            </td>
                          </tr>
                          <tr>
                             <td style="width:220px;" align="right">&nbsp;</td>
                            <td align="left">
                               <asp:Button ID="BtnPrintDetail" runat="server" CssClass="ButtonStyle" Text="Print" />
                               <asp:Button ID="BtnClearDetail" runat="server" CssClass="ButtonStyle" Text="ปิด" />
                            </td>
                          </tr>
                       </table>
                                                     </asp:Panel>
                                                 </fieldset>
                                            </td>
                                        </tr>
                                    </table>
                                </ContentTemplate>
                            </asp:TabPanel>
                       </asp:TabContainer>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
   </asp:UpdatePanel>
</asp:Content>
